May 03, 2013
On Friday, 3 May 2013 at 00:24:50 UTC, Alexandr Druzhinin wrote:
> 03.05.2013 6:12, Carlos пишет:
>>>
>>> Normally the example looks for builderTest.glade in the directory
>>> where the binary is.
>>>
>>> There one in the GtkD git
>>> https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.glade
>>>
>>>
>>> You can also specify a different glade file on the commandline, the
>>> example code tries to access a wiget named window1 if it's not
>>> pressent in the glade file it will print "No window?" and exit.
>>
>> I can't believe an hour has passed so easy.
>>
>> How do I specify the doferent glade ?, During compilation ?
> if you mean glade file with different name then answer is yes. but if you just want to use another glade file with the same name then answer is no. this different glade file should has window widget with name window1 but with the rest no other restrictions exist. with glade you can create more complex application easer and after debugging build glade file into your application.
Right now I want to use the glade file form the site.
May 03, 2013
03.05.2013 7:24, Alexandr Druzhinin пишет:
>>
>> I can't believe an hour has passed so easy.
>>
>> How do I specify the doferent glade ?, During compilation ?
> if you mean glade file with different name then answer is yes. but if
> you just want to use another glade file with the same name then answer
> is no. this different glade file should has window widget with name
> window1 but with the rest no other restrictions exist. with glade you
> can create more complex application easer and after debugging build
> glade file into your application.
I was totally wrong - didn't look at code before :(
The right answer to your question is you can specify your own glade file into command line as second argument like this:
builder /path/to/your/glade/file/your.glade
it will be enough
May 03, 2013
> I was totally wrong - didn't look at code before :(
> The right answer to your question is you can specify your own glade file into command line as second argument like this:
> builder /path/to/your/glade/file/your.glade
> it will be enough

Ok I'll try that.
May 03, 2013
On Friday, 3 May 2013 at 00:30:00 UTC, Alexandr Druzhinin wrote:
> 03.05.2013 7:24, Alexandr Druzhinin пишет:
>>>
>>> I can't believe an hour has passed so easy.
>>>
>>> How do I specify the doferent glade ?, During compilation ?
>> if you mean glade file with different name then answer is yes. but if
>> you just want to use another glade file with the same name then answer
>> is no. this different glade file should has window widget with name
>> window1 but with the rest no other restrictions exist. with glade you
>> can create more complex application easer and after debugging build
>> glade file into your application.
> I was totally wrong - didn't look at code before :(
> The right answer to your question is you can specify your own glade file into command line as second argument like this:
> builder /path/to/your/glade/file/your.glade
> it will be enough

Sorry if this was too wild but this is what I can do at the moment since I don't see a "gladeText" program which I believe is required for this action I did my guess.

code:

dmd builderTest.d $(pkg-config --cflags --libs gtkd-2) builder ~/Documents/Glade/builderTest.glade

gives error :

Error: unrecognized file extension glade

-----------------------------------------------------------------

gtkD samples give error but I'm not using the same software from developers I'll try to install by purge all gtkD programs installed by no and trying "make install" again. Then check if the samples compile right.
May 03, 2013
03.05.2013 7:55, Carlos пишет:
>
> Sorry if this was too wild but this is what I can do at the moment since
> I don't see a "gladeText" program which I believe is required for this
> action I did my guess.
>
> code:
>
> dmd builderTest.d $(pkg-config --cflags --libs gtkd-2) builder
> ~/Documents/Glade/builderTest.glade
>
> gives error :
>
> Error: unrecognized file extension glade
>
> -----------------------------------------------------------------
>
> gtkD samples give error but I'm not using the same software from
> developers I'll try to install by purge all gtkD programs installed by
> no and trying "make install" again. Then check if the samples compile
> right.
first build application:
dmd builderTest.d $(pkg-config --cflags --libs gtkd-2)

then run it:
builder ~/Documents/Glade/builderTest.glade
May 03, 2013
03.05.2013 0:43, Mike Wey пишет:
> On 05/02/2013 03:58 PM, Alexandr Druzhinin wrote:
>> How to use GtkD with Glade? Is some tutorial available?
>> I spent some time trying to use Glade to build non-trivial application,
>> but I do it very inproductive, so I'd like to get some help or I'm
>> afraid it will be lasting for years...
>> For example, if somebody would upload some example of Gtk application,
>> that built with glade and has several typical widgets and signal
>> handlers - it may help very much.
>
> There is an small example distributed with GtkD:
> https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.d
>
>
won't it be better to have the simple template to hide cast() using Builder.getObject():

auto getObjectAs(T)(Builder b, string object_name) {
	return cast(T) b.getObject(object_name);
}
?
May 03, 2013
On Friday, 3 May 2013 at 00:58:36 UTC, Alexandr Druzhinin wrote:
> 03.05.2013 7:55, Carlos пишет:
>>
>> Sorry if this was too wild but this is what I can do at the moment since
>> I don't see a "gladeText" program which I believe is required for this
>> action I did my guess.
>>
>> code:
>>
>> dmd builderTest.d $(pkg-config --cflags --libs gtkd-2) builder
>> ~/Documents/Glade/builderTest.glade
>>
>> gives error :
>>
>> Error: unrecognized file extension glade
>>
>> -----------------------------------------------------------------
>>
>> gtkD samples give error but I'm not using the same software from
>> developers I'll try to install by purge all gtkD programs installed by
>> no and trying "make install" again. Then check if the samples compile
>> right.
> first build application:
> dmd builderTest.d $(pkg-config --cflags --libs gtkd-2)
>
> then run it:
> builder ~/Documents/Glade/builderTest.glade

I got it working now. I'm using the sample code and I made another layout with Glade for GTK+3 and saved it with the same name, so when I compile the file is called and I get the UI I wanted.
May 03, 2013
On Friday, 3 May 2013 at 01:27:54 UTC, Carlos wrote:
> On Friday, 3 May 2013 at 00:58:36 UTC, Alexandr Druzhinin wrote:
>> 03.05.2013 7:55, Carlos пишет:
>>>
>>> Sorry if this was too wild but this is what I can do at the moment since
>>> I don't see a "gladeText" program which I believe is required for this
>>> action I did my guess.
>>>
>>> code:
>>>
>>> dmd builderTest.d $(pkg-config --cflags --libs gtkd-2) builder
>>> ~/Documents/Glade/builderTest.glade
>>>
>>> gives error :
>>>
>>> Error: unrecognized file extension glade
>>>
>>> -----------------------------------------------------------------
>>>
>>> gtkD samples give error but I'm not using the same software from
>>> developers I'll try to install by purge all gtkD programs installed by
>>> no and trying "make install" again. Then check if the samples compile
>>> right.
>> first build application:
>> dmd builderTest.d $(pkg-config --cflags --libs gtkd-2)
>>
>> then run it:
>> builder ~/Documents/Glade/builderTest.glade
>
> I got it working now. I'm using the sample code and I made another layout with Glade for GTK+3 and saved it with the same name, so when I compile the file is called and I get the UI I wanted.

SO now next step is to learn the signals part, Right ?
May 03, 2013
On Friday, 3 May 2013 at 01:00:48 UTC, Alexandr Druzhinin wrote:
> 03.05.2013 0:43, Mike Wey пишет:
>> On 05/02/2013 03:58 PM, Alexandr Druzhinin wrote:
>>> How to use GtkD with Glade? Is some tutorial available?
>>> I spent some time trying to use Glade to build non-trivial application,
>>> but I do it very inproductive, so I'd like to get some help or I'm
>>> afraid it will be lasting for years...
>>> For example, if somebody would upload some example of Gtk application,
>>> that built with glade and has several typical widgets and signal
>>> handlers - it may help very much.
>>
>> There is an small example distributed with GtkD:
>> https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.d
>>
>>
> won't it be better to have the simple template to hide cast() using Builder.getObject():
>
> auto getObjectAs(T)(Builder b, string object_name) {
> 	return cast(T) b.getObject(object_name);
> }
> ?
Thank you very much for your help! It's being the whole day working on this.
May 03, 2013
On Thursday, 2 May 2013 at 22:07:46 UTC, Mike Wey wrote:
> On 05/02/2013 11:25 PM, Carlos wrote:
>>
>>>
>>> Try:
>>>
>>> dmd testgithub.d $(pkg-config --cflags --libs gtkd-2)
>>
>> It compiles but doesn't run well. I'm checking this comment on the code.
>>
>> /**
>> * Usage ./gladeText /path/to/your/glade/file.glade
>> *
>> */
>
> Normally the example looks for builderTest.glade in the directory where the binary is.
>
> There one in the GtkD git https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.glade
>
> You can also specify a different glade file on the commandline, the example code tries to access a wiget named window1 if it's not pressent in the glade file it will print "No window?" and exit.
Thanks Mike Wey this was crucial on this workaround.