Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Nov 2014, 16:45
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Gtkdialog Development
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 53, 54, 55 Next
Author Message
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sat 02 Jul 2011, 09:21    Post subject:  

vovchik wrote:
Thanks a million. The glade problem is fixed! And the new combotext widget is great. I am now revising scripts to take advantage of it.

You're welcome. Storing binary files in shell variables is noted.

01micko wrote:
Seems `gtk_widget_get_realized' isn't introduced until gtk+-2.20 so the latest revision fails to compile in Puppy-431. (gtk+-2.14)

Any work around possible?

Yep, implemented and committed Smile Also get the latest example as I've updated it.

BTW I've got an impression that some people might be checking-out the entire project everytime I make a revision. For those people (if there are any) all that's required is to type "svn update" from within the same folder whenever you feel like doing it and you'll be in sync with the repository Smile I'll write it up on the first page.
Back to top
View user's profile Send private message Visit poster's website 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Sat 02 Jul 2011, 11:05    Post subject:  

thunar,

Fantastic! Smile Smile

Thank you - I downloaded and compiled in pup431 and all is well.

Regards,
s
Back to top
View user's profile Send private message 
Aitch


Joined: 04 Apr 2007
Posts: 6825
Location: Chatham, Kent, UK

PostPosted: Sat 02 Jul 2011, 13:53    Post subject:  

Hi

Grat work thunar, you are a great addition to the team

Possibly aside/

Don't know whether this is appropriate, [I think there's a GTK connection] but for widget builders/graphics projects, see nip2/VIPS

http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/nipguide/nipguidese3.html

http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS

Come across while researching VPT6

http://hcgilje.wordpress.com/

....if anyone knows how to get it to run under linux...?

thanks

Aitch Smile
Back to top
View user's profile Send private message 
pemasu


Joined: 08 Jul 2009
Posts: 5465
Location: Finland

PostPosted: Sat 02 Jul 2011, 14:56    Post subject:  

I know nothing about this, but I seem to have compiled them or at least packaged them. I dont remember anymore why I made the package, lol.
The needed libs are included. Pet is 4.4 Mb. Quite big in Puppy's view.
http://www.smokey01.com/pemasu/Pets/vips-nip2-0.0.1.pet
Back to top
View user's profile Send private message 
Aitch


Joined: 04 Apr 2007
Posts: 6825
Location: Chatham, Kent, UK

PostPosted: Sat 02 Jul 2011, 15:25    Post subject:  

Thanks pemasu

I probably wasn't clear

I was searching for an implementation of VPT 6.0 in linux [Video Projection Tool/3D mapper/ multilayer renderer thingy]

Quote:
Exploring how audiovisual technology can be used to transform, create, expand, amplify and interpret physical spaces.


I'm interested in Artistic projection displays, possibly dynamic


I think this may be useful

http://forum.openframeworks.cc/index.php?&topic=5133.0

http://www.hv-a.com/lpmt/

Aitch Smile
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Sat 02 Jul 2011, 18:03    Post subject:  

According to the Gtk specs, the button widget has an "image-position" property which defines the position of the image relative to the text inside the button. The default is left and works, but as zigbert has mentioned, in gtkdialog it does not work for any other position unless it's a gtk-stock image.

This means you can't really put a caption above or below a button image where multiple button images are used in rows.

I was wondering if this is just a gtkdialog problem or if Gtk designed it only to be used with gtk-stock images.

Cheers,
s
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sun 03 Jul 2011, 07:47    Post subject:  

seaside wrote:
Thank you - I downloaded and compiled in pup431 and all is well.

That's good news Smile

seaside wrote:
According to the Gtk specs, the button widget has an "image-position" property which defines the position of the image relative to the text inside the button. The default is left and works, but as zigbert has mentioned, in gtkdialog it does not work for any other position unless it's a gtk-stock image.

This means you can't really put a caption above or below a button image where multiple button images are used in rows.

I was wondering if this is just a gtkdialog problem or if Gtk designed it only to be used with gtk-stock images.

Cheers,
s

This is how gtkdialog constructs a button: A GtkButton containing either a GtkLabel, a GtkImage or both packed inside a GtkHBox.

The key point here is that if it's a stock image it's managed by GTK, but an image file with a label goes into an hbox; that's the way the original author designed it. Anything that gets hardcoded can be made a choice via a tag attribute. I agree that it would be nice to have images from files placed atop labels so I'll add a feature request for it.

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Sun 03 Jul 2011, 10:39    Post subject:  

thunor,

Thanks for taking the time to explain why this doesn't work. Many of us know what doesn't work, but really don't know why, and have no avenue to actually find out - except, of course, by having a resident expert Smile

Thank you again for all your exceptional work.

Regards,
s
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sun 03 Jul 2011, 18:54    Post subject:  

seaside wrote:
disciple wrote:
Hi guys,
Do you have any idea if it would be feasible to enable gtkdialog to display an image from standard input (perhaps I'm not using this term correctly - see my explanation below)?

Here's a simple example of what I mean:
If a jpeg file has an exif thumbnail I can use the jhead command to extract this to a file. I can also extract it to standard output (-) like this `jhead -st - /24543.jpg`
So do you think it would be possible to enable the use of something like this?:
Code:
    <pixmap>
      <input command>jhead -st - /24543.jpg</input>
    </pixmap>


Don't worry, I'm not thinking of writing a gtkdialog gui for all the command line image editors... although that would be interesting Wink


disciple,

I think this could work. I don't have jhead, so can't check.

Code:
 
<pixmap>
  <input file>$(jhead -st - /24543.jpg)</input>
</pixmap>


Cheers,
s

I'm creating some feature requests for a few things people have been asking about.

I'm wondering why you would want to pipe images into gtkdialog when you can load them as files. Is it just so that you can get gtkdialog to run a command to extract the thumbnail instead of writing it into the XML with shell script? When you refresh the pixmap widget you'll need to do it on a signal likely connected to a button, and you can have two actions, the first extracting the thumbnail and the second refreshing the pixmap widget.

There already exists a directive for inputting data from a shell command - <input></intput> - so that could be used, but I still don't see what benefit it would be to implement it. Maybe I'm missing something Smile
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Mon 04 Jul 2011, 01:46    Post subject: pic data in hex  

Dear thunor,

If hex data could be accomodated in the source, there could be a self-contained app. For time-critical applications - e.g. games - the pix data would be in the script, obviating a need for multiple disk reads. Just an idea.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6458
Location: Auckland, New Zealand

PostPosted: Mon 04 Jul 2011, 04:05    Post subject:  

thunor wrote:
I'm wondering why you would want to pipe images into gtkdialog when you can load them as files.

I would rather not create the files, that's all.
Quote:
Is it just so that you can get gtkdialog to run a command to extract the thumbnail

Yes.
Quote:
instead of writing it into the XML with shell script?

I'm not certain what you mean here - how can I write the thumbnail into the XML?
Quote:
When you refresh the pixmap widget you'll need to do it on a signal likely connected to a button, and you can have two actions, the first extracting the thumbnail and the second refreshing the pixmap widget.

I'm not so much interested in refreshing the widget. An example of what I would like to do could be modifying pmetatagger so that when it reads the tag of a jpeg or an mp3 it displays the exif thumbnail or the embedded album art, without saving it as a temporary file. Similarly, Pmusic could display embedded album art.

But there would be some seriously cool uses for it in combination with refreshing a widget - e.g. a gtkdialog photo browser could be written, which would display the embedded thumbnails for all the images in a directory, in a scrollable hbox (or vbox), and clicking on a thumbnail would display the full size image above (or to the right of) the hbox (or vbox). This would not be the best way to implement a photo browser, but it would be cool Wink
Quote:
There already exists a directive for inputting data from a shell command - <input></intput> - so that could be used, but I still don't see what benefit it would be to implement it. Maybe I'm missing something Smile

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4380

PostPosted: Mon 04 Jul 2011, 19:21    Post subject:  

It took me a bit to figure out how to use gtkbuilder, but I was able to tweak one of the vala/gtkbuilder examples to behave similar to glade+gtkdialog (after compiling to c)

It would display the GUI fine but I couldn't get the actions to run scripts functions like gtkdialog ... what code does that part? ... maybe we could use it to remove the optional (and deprecated) glade dependencies.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Tue 05 Jul 2011, 12:25    Post subject:  

Added button widget image positioning capability

The widget reference is available here.

Now all buttons with images can use the "image-position" tag attribute Smile Use values of "0/1/2/3". Note that this is an existing GTK property that already worked with stock buttons but I have extended it to work with Gtkdialog's image buttons. If you use it in the custom sense then you can also pass "left/right/top/bottom".

Example:
Code:
#!/bin/sh

# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.

GTKDIALOG=gtkdialog

function funcbtnType0Create() {
   echo '<button image-position="'$1'" use-stock="true" label="gtk-'$2'">
         <action>""</action>
      </button>'
}

function funcbtnType1Create() {
   echo '<button image-position="'$1'">
         <label>'$1'</label>
         <input file stock="gtk-'$2'"></input>
         <action>""</action>
      </button>'
}

function funcbtnType2Create() {
   echo '<button image-position="'$1'">
         <label>'$1'</label>
         <variable>btn'$2$1'</variable>
         <input file>image.svg</input>
         <action>echo Refreshing btn'$2$1'</action>
         <action>refresh:btn'$2$1'</action>
      </button>'
}

function funcbtnType3Create() {
   echo '<button image-position="'$1'">
         <label>'$1'</label>
         <variable>btn'$2$1'</variable>
         <input file>image.svg</input>
         <width>64</width>
         <action>echo Refreshing btn'$2$1'</action>
         <action>refresh:btn'$2$1'</action>
      </button>'
}

function funcimgCreate() {
   echo '<svg  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
         <rect x="0" y="0" height="32" width="32" fill="#000000"/>
         <rect x="2" y="2" height="28" width="28" fill="#ffffff"/>
         <rect x="16" y="16" height="12" width="12" fill="#d0d0d0"/>
         <rect x="4" y="16" height="12" width="12" fill="#a0a0a0"/>
         <rect x="4" y="4" height="12" width="12" fill="#707070"/>
         <rect x="16" y="4" height="12" width="12" fill="#404040"/>
         <rect x="18" y="18" height="4" width="4" fill="#ffffff"/>
         <rect x="22" y="18" height="4" width="4" fill="#a0a0a0"/>
         <rect x="22" y="22" height="4" width="4" fill="#707070"/>
         <rect x="18" y="22" height="4" width="4" fill="#404040"/>
      </svg>' > image.svg
}; export -f funcimgCreate

if [ ! -f image.svg ]; then funcimgCreate; fi

export MAIN_DIALOG='
<window title="btnImagePosition" width-request="500" resizable="false">
   <vbox>
      <frame Stock images (and labels) using GTK properties>
         <hbox homogeneous="true">
            '"$(funcbtnType0Create 0 about)"'
            '"$(funcbtnType0Create 1 add)"'
            '"$(funcbtnType0Create 2 apply)"'
            '"$(funcbtnType0Create 3 bold)"'
         </hbox>
      </frame>
      <frame Stock images using Gtkdialog directives>
         <hbox homogeneous="true">
            '"$(funcbtnType1Create Left about)"'
            '"$(funcbtnType1Create Right add)"'
            '"$(funcbtnType1Create Top apply)"'
            '"$(funcbtnType1Create Bottom bold)"'
         </hbox>
      </frame>
      <frame Images from files using Gtkdialog directives>
         <hbox homogeneous="true">
            '"$(funcbtnType2Create Left Woden)"'
            '"$(funcbtnType2Create Right Woden)"'
            '"$(funcbtnType2Create Top Woden)"'
            '"$(funcbtnType2Create Bottom Woden)"'
         </hbox>
      </frame>
      <frame Scaled images from files using Gtkdialog directives>
         <hbox homogeneous="true">
            '"$(funcbtnType3Create Left Frige)"'
            '"$(funcbtnType3Create Right Frige)"'
            '"$(funcbtnType3Create Top Frige)"'
            '"$(funcbtnType3Create Bottom Frige)"'
         </hbox>
      </frame>
      <hbox homogeneous="true">
         <button>
            <label>Remove/Create Image</label>
            <variable>btnimgControl</variable>
            <input file>image.svg</input>
            <width>16</width>
            <action>if [ ! -f image.svg ]; then funcimgCreate; else rm image.svg; fi</action>
            <action>refresh:btnimgControl</action>
         </button>
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --center --program=MAIN_DIALOG

Regards,
Thunor

Last edited by thunor on Fri 12 Aug 2011, 09:55; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Tue 05 Jul 2011, 17:11    Post subject:  

Aitch: Thanks for the encouragement Smile

disciple: Yeah, I see the point about creating many thumbnails without the many temporary files to go with them Smile BTW the Gtkdialog Application Index is a really great resource but I'm linking to it from the Gtkdialog project page and I have to login to view it. Is that right?

technosaurus wrote:
It took me a bit to figure out how to use gtkbuilder, but I was able to tweak one of the vala/gtkbuilder examples to behave similar to glade+gtkdialog (after compiling to c)

It would display the GUI fine but I couldn't get the actions to run scripts functions like gtkdialog ... what code does that part? ... maybe we could use it to remove the optional (and deprecated) glade dependencies.

glade_support.c is the interface between Glade and Gtkdialog. I had to update it to support the new comboboxtext widget, so it's something that has to be maintained even if there're only one or two application developers using it. Maybe we should specifically state that Glade support is deprecated.

Last edited by thunor on Tue 05 Jul 2011, 17:30; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Tue 05 Jul 2011, 17:24    Post subject:  

thunor,

I updated (carefully using svn update Smile ) and compiled your latest in pup431. I can happily report that you've scored another very nice new capability.

The example is great and it looks like gtkdialog and you were made for each other. Cool

Regards,
s
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 53, 54, 55 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1303s ][ Queries: 13 (0.0068s) ][ GZIP on ]